import {createStore,applyMiddleware} from 'redux'
//引入为Count组件服务的reducer
// import count_reducer from './reducers/count'
// import person_reducer from './reducers/person'
import thunk from 'redux-thunk'
//引入redux开发者工具
import {composeWithDevTools} from 'redux-devtools-extension'
import allReducers from './reducers/index'
//暴露store,redux-thunk是让action支持异步操作
//combineReducers汇总所有的reducer
// const allReducers=combineReducers({
//   sum:count_reducer,
//   person_array:person_reducer
// })
//优化combineReducers，引入外部暴露所有reducer的js文件
// export default createStore(count_reducer,applyMiddleware(thunk))
export default createStore(allReducers,composeWithDevTools(applyMiddleware(thunk)))